/******************************************************************************/
package jamie.org.sil.www.UsxConfigEditor;

import java.util.ArrayList;


/******************************************************************************/
/**
 * All information which is specific to the vernacularParms file.  (A concrete
 * realisation of XmlDetails.)
 * <p>
 *
 * Note that the order in which tags are added to the data structures here
 * determines the order in which they will be written out to the XML file.
*/

public class XmlDetailsVernacularParms extends XmlDetails
{
  /****************************************************************************/
  /****************************************************************************/
  /**                                                                        **/
  /**                               Public                                   **/
  /**                                                                        **/
  /****************************************************************************/
  /****************************************************************************/


  /****************************************************************************/
  /** Constructor.
   *
   * @throws RuntimeException
   */

  public XmlDetailsVernacularParms () throws RuntimeException
  {
    String[] tabNames = getTabNames();
    for (int i = 0; i < tabNames.length; ++i)
      m_PerTabTagTable.put(i, new ArrayList<ConfigTag.Generic>(100));

    doTagsBibleBooks();
    doTagsDublinCore();
    doTagsLanguage();
    doTagsMiscellaneous();
    doTagsText();
  }


  /****************************************************************************/
  /** Gets the default file name to be offered to the user when writing data.
   *
   * @return Default file name.
   */

  @Override public String getDefaultFileName ()
  {
    String variant = ((String) m_OverallTagTable.get("isoVariant").getValue()).toLowerCase();
    return ((String) m_OverallTagTable.get("iso").getValue()).toUpperCase() +
           (0 == variant.length() ? "" : "-" + variant) +  
           "-VernacularParms.xml";
  }


  /****************************************************************************/
  /** Returns the root tag to be used when writing the output file.
   * 
   * @return Root tag.
   */

  @Override public String getRootTag ()
  {
    return "vernacularParms";
  }


  /****************************************************************************/
  /** Gets the names to be applied to the tabs on the tabbed pane.
   *
   * @return names
   */

  @Override final public String[] getTabNames ()
  {
    String s[] = {"Language", "Scripture books", "Text", "Dublin Core", "Miscellaneous"};
    return s;
  }






  /****************************************************************************/
  /****************************************************************************/
  /**                                                                        **/
  /**                               Private                                  **/
  /**                                                                        **/
  /****************************************************************************/
  /****************************************************************************/

  /****************************************************************************/
  /* Add details of a single Bible book.  (It's convenient to do this in a
     separate routine, because we have two tags for each book, and doing it
     this way saves typing. */

  private ConfigTag.Generic bibleBook (String fullOrAbbreviated, String name, String ubsAbbrev)
  {
    if ("f".equalsIgnoreCase(fullOrAbbreviated.toLowerCase().substring(0,1)))
      return addTag(new ConfigTag.Text("scriptureBook ubsAbbreviation='" + ubsAbbrev + "' parm='vernacularFullName'",
                                       name + " (full name)",
                                       "",
                                       "",
                                       ConfigTag.Optionality.C_Optional));

    else
      return addTag(new ConfigTag.Text("scriptureBook ubsAbbreviation='" + ubsAbbrev + "' parm='vernacularAbbreviatedName'",
                                       name + " (abbreviated name)",
                                       "",
                                       "",
                                       ConfigTag.Optionality.C_Optional));
  }


  /****************************************************************************/
  /* Add details of Bible books. */

  private void doTagsBibleBooks () throws RuntimeException
  {
    setTabNo("Scripture books");
    addTag(new ConfigTag.Header("Full names of Bible books ..."));
    bibleBook("f", "Genesis",                      "GEN").setPrefix("<!-- Start of scripture details -->");
    bibleBook("f", "Exodus",                       "EXO");
    bibleBook("f", "Leviticus",                    "LEV");
    bibleBook("f", "Numbers",                      "NUM");
    bibleBook("f", "Deuteronomy",                  "DEU");
    bibleBook("f", "Joshua",                       "JOS");
    bibleBook("f", "Judges",                       "JDG");
    bibleBook("f", "Ruth",                         "RUT");
    bibleBook("f", "1 Samuel",                     "1SA");
    bibleBook("f", "2 Samuel",                     "2SA");
    bibleBook("f", "1 Kings",                      "1KI");
    bibleBook("f", "2 Kings",                      "2KI");
    bibleBook("f", "1 Chronicles",                 "1CH");
    bibleBook("f", "2 Chronicles",                 "2CH");
    bibleBook("f", "Ezra",                         "EZR");
    bibleBook("f", "Nehemiah",                     "NEH");
    bibleBook("f", "Esther",                       "EST");
    bibleBook("f", "Job",                          "JOB");
    bibleBook("f", "Psalms",                       "PSA");
    bibleBook("f", "Proverbs",                     "PRO");
    bibleBook("f", "Ecclesiastes",                 "ECC");
    bibleBook("f", "Song of Solomon",              "SNG");
    bibleBook("f", "Isaiah",                       "ISA");
    bibleBook("f", "Jeremiah",                     "JER");
    bibleBook("f", "Lamentations",                 "LAM");
    bibleBook("f", "Ezekiel",                      "EZK");
    bibleBook("f", "Daniel",                       "DAN");
    bibleBook("f", "Hosea",                        "HOS");
    bibleBook("f", "Joel",                         "JOL");
    bibleBook("f", "Amos",                         "AMO");
    bibleBook("f", "Obadiah",                      "OBA");
    bibleBook("f", "Jonah",                        "JON");
    bibleBook("f", "Micah",                        "MIC");
    bibleBook("f", "Nahum",                        "NAM");
    bibleBook("f", "Habakkuk",                     "HAB");
    bibleBook("f", "Zephaniah",                    "ZEP");
    bibleBook("f", "Haggai",                       "HAG");
    bibleBook("f", "Zechariah",                    "ZEC");
    bibleBook("f", "Malachi",                      "MAL");

    bibleBook("f", "Matthew",                      "MAT");
    bibleBook("f", "Mark",                         "MRK");
    bibleBook("f", "Luke",                         "LUK");
    bibleBook("f", "John",                         "JHN");
    bibleBook("f", "Acts",                         "ACT");
    bibleBook("f", "Romans",                       "ROM");
    bibleBook("f", "1 Corinthians",                "1CO");
    bibleBook("f", "2 Corinthians",                "2CO");
    bibleBook("f", "Galatians",                    "GAL");
    bibleBook("f", "Ephesians",                    "EPH");
    bibleBook("f", "Philippians",                  "PHP");
    bibleBook("f", "Colossians",                   "COL");
    bibleBook("f", "1 Thessalonians",              "1TH");
    bibleBook("f", "2 Thessalonians",              "2TH");
    bibleBook("f", "1 Timothy",                    "1TI");
    bibleBook("f", "2 Timothy",                    "2TI");
    bibleBook("f", "Titus",                        "TIT");
    bibleBook("f", "Philemon",                     "PHM");
    bibleBook("f", "Hebrews",                      "HEB");
    bibleBook("f", "James",                        "JAS");
    bibleBook("f", "1 Peter",                      "1PE");
    bibleBook("f", "2 Peter",                      "2PE");
    bibleBook("f", "1 John",                       "1JN");
    bibleBook("f", "2 John",                       "2JN");
    bibleBook("f", "3 John",                       "3JN");
    bibleBook("f", "Jude",                         "JUD");
    bibleBook("f", "Revelation",                   "REV");

    bibleBook("f", "Tobit",                        "TOB");
    bibleBook("f", "Judith",                       "JDT");
    bibleBook("f", "Additions to Esther (Greek)",  "ESG");
    bibleBook("f", "Wisdom of Solomon",            "WIS");
    bibleBook("f", "Sirach",                       "SIR");
    bibleBook("f", "Baruch",                       "BAR");
    bibleBook("f", "Epistle of Jeremiah",          "LJE");
    bibleBook("f", "Song of the Three Young Men",  "S3Y");
    bibleBook("f", "Susannah",                     "SUS");
    bibleBook("f", "Bel and the Dragon",           "BEL");
    bibleBook("f", "1 Maccabees",                  "1MA");
    bibleBook("f", "2 Maccabees",                  "2MA");
    bibleBook("f", "3 Maccabees",                  "3MA");
    bibleBook("f", "4 Maccabees",                  "4MA");
    bibleBook("f", "1 Esdras",                     "1ES");
    bibleBook("f", "2 Esdras",                     "2ES");
    bibleBook("f", "Prayer of Manasseh",           "MAN");
    bibleBook("f", "Prayer of Azariah",            "ODA");
    bibleBook("f", "Psalm 151 (Psalm of Solomon)", "PSS");
    bibleBook("f", "Additions to Daniel",          "DNT");



    addTag(new ConfigTag.Header(""));
    addTag(new ConfigTag.Header(""));
    addTag(new ConfigTag.Header("Abbreviated names of Bible books ..."));
    bibleBook("a", "Genesis",                      "GEN");
    bibleBook("a", "Exodus",                       "EXO");
    bibleBook("a", "Leviticus",                    "LEV");
    bibleBook("a", "Numbers",                      "NUM");
    bibleBook("a", "Deuteronomy",                  "DEU");
    bibleBook("a", "Joshua",                       "JOS");
    bibleBook("a", "Judges",                       "JDG");
    bibleBook("a", "Ruth",                         "RUT");
    bibleBook("a", "1 Samuel",                     "1SA");
    bibleBook("a", "2 Samuel",                     "2SA");
    bibleBook("a", "1 Kings",                      "1KI");
    bibleBook("a", "2 Kings",                      "2KI");
    bibleBook("a", "1 Chronicles",                 "1CH");
    bibleBook("a", "2 Chronicles",                 "2CH");
    bibleBook("a", "Ezra",                         "EZR");
    bibleBook("a", "Nehemiah",                     "NEH");
    bibleBook("a", "Esther",                       "EST");
    bibleBook("a", "Job",                          "JOB");
    bibleBook("a", "Psalms",                       "PSA");
    bibleBook("a", "Proverbs",                     "PRO");
    bibleBook("a", "Ecclesiastes",                 "ECC");
    bibleBook("a", "Song of Solomon",              "SNG");
    bibleBook("a", "Isaiah",                       "ISA");
    bibleBook("a", "Jeremiah",                     "JER");
    bibleBook("a", "Lamentations",                 "LAM");
    bibleBook("a", "Ezekiel",                      "EZK");
    bibleBook("a", "Daniel",                       "DAN");
    bibleBook("a", "Hosea",                        "HOS");
    bibleBook("a", "Joel",                         "JOL");
    bibleBook("a", "Amos",                         "AMO");
    bibleBook("a", "Obadiah",                      "OBA");
    bibleBook("a", "Jonah",                        "JON");
    bibleBook("a", "Micah",                        "MIC");
    bibleBook("a", "Nahum",                        "NAM");
    bibleBook("a", "Habakkuk",                     "HAB");
    bibleBook("a", "Zephaniah",                    "ZEP");
    bibleBook("a", "Haggai",                       "HAG");
    bibleBook("a", "Zechariah",                    "ZEC");
    bibleBook("a", "Malachi",                      "MAL");

    bibleBook("a", "Matthew",                      "MAT");
    bibleBook("a", "Mark",                         "MRK");
    bibleBook("a", "Luke",                         "LUK");
    bibleBook("a", "John",                         "JHN");
    bibleBook("a", "Acts",                         "ACT");
    bibleBook("a", "Romans",                       "ROM");
    bibleBook("a", "1 Corinthians",                "1CO");
    bibleBook("a", "2 Corinthians",                "2CO");
    bibleBook("a", "Galatians",                    "GAL");
    bibleBook("a", "Ephesians",                    "EPH");
    bibleBook("a", "Philippians",                  "PHP");
    bibleBook("a", "Colossians",                   "COL");
    bibleBook("a", "1 Thessalonians",              "1TH");
    bibleBook("a", "2 Thessalonians",              "2TH");
    bibleBook("a", "1 Timothy",                    "1TI");
    bibleBook("a", "2 Timothy",                    "2TI");
    bibleBook("a", "Titus",                        "TIT");
    bibleBook("a", "Philemon",                     "PHM");
    bibleBook("a", "Hebrews",                      "HEB");
    bibleBook("a", "James",                        "JAS");
    bibleBook("a", "1 Peter",                      "1PE");
    bibleBook("a", "2 Peter",                      "2PE");
    bibleBook("a", "1 John",                       "1JN");
    bibleBook("a", "2 John",                       "2JN");
    bibleBook("a", "3 John",                       "3JN");
    bibleBook("a", "Jude",                         "JUD");
    bibleBook("a", "Revelation",                   "REV");

    bibleBook("a", "Tobit",                        "TOB");
    bibleBook("a", "Judith",                       "JDT");
    bibleBook("a", "Additions to Esther (Greek)",  "ESG");
    bibleBook("a", "Wisdom of Solomon",            "WIS");
    bibleBook("a", "Sirach",                       "SIR");
    bibleBook("a", "Baruch",                       "BAR");
    bibleBook("a", "Epistle of Jeremiah",          "LJE");
    bibleBook("a", "Song of the Three Young Men",  "S3Y");
    bibleBook("a", "Susannah",                     "SUS");
    bibleBook("a", "Bel and the Dragon",           "BEL");
    bibleBook("a", "1 Maccabees",                  "1MA");
    bibleBook("a", "2 Maccabees",                  "2MA");
    bibleBook("a", "3 Maccabees",                  "3MA");
    bibleBook("a", "4 Maccabees",                  "4MA");
    bibleBook("a", "1 Esdras",                     "1ES");
    bibleBook("a", "2 Esdras",                     "2ES");
    bibleBook("a", "Prayer of Manasseh",           "MAN");
    bibleBook("a", "Prayer of Azariah",            "ODA");
    bibleBook("a", "Psalm 151 (Psalm of Solomon)", "PSS");
    bibleBook("a", "Additions to Daniel",          "DNT").setSuffix("<!-- End of scripture details -->");
  }


  /****************************************************************************/
  /* Add details of Dublin Core tags. */

  private void doTagsDublinCore () throws RuntimeException
  {
    setTabNo("Dublin Core");

    addTag(new ConfigTag.Text("dc:creator",
                              "Name of translator",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional)).
      setPrefix("<!-- Start of Dublin Core -->" + XmlFile.C_LineSeparator + "<dcMeta xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd' xmlns:dc='http://purl.org/dc/elements/1.1/'>");

    addTag(new ConfigTag.Text("dc:contributor",
                              "Name of contributor",
                              "",
                              "Kalaam Media Ltd",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:title",
                              "Short string for use as window titles etc",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:description",
                              "Description of text",
                              "eg Spanish New Testament",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:date",
                              "Date of this version of text (yyyy-mm-dd)",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:language",
                              "Language designator (eg x-sil-xyz)",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:publisher",
                              "Name of publisher",
                              "",
                              "Kalaam Media Ltd",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:rights",
                              "Statement of rights",
                              "",
                              "All rights reserved",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:identifier",
                              "Identifier (don't know what this is ???)",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("dc:type",
                              "Type (don't know what this is ???)",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional)).
      setSuffix("</dcMeta>" + XmlFile.C_LineSeparator +"<!-- End of Dublin Core -->");
  }


  /****************************************************************************/
  /* Add details of miscellaneous tags. */

  private void doTagsLanguage () throws RuntimeException
  {
    setTabNo("Language");

    addTag(new ConfigTag.Header("Language details"));

    addTag(new ConfigTag.Header("Make sure you fill these in before doing anything else"));

    addTag(new ConfigTag.Text("iso",
                              "ISO language code",
                              "",
                              "",
                              ConfigTag.Optionality.C_Mandatory)).
     setPrefix("<!-- Start of language data -->");

    addTag(new ConfigTag.Text("isoVariant",
                              "ISO language variant code",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("langName",
                              "Language name",
                              "Name by which the vernacular language is known in English",
                              "",
                              ConfigTag.Optionality.C_Optional)).
      setSuffix("<!-- End of miscellaneous data -->");
  }


  /****************************************************************************/
  /* Add details of miscellaneous tags. */

  private void doTagsMiscellaneous () throws RuntimeException
  {
    setTabNo("Miscellaneous");

    addTag(new ConfigTag.Header("Numbering scheme and versification scheme"));

    addTag(new ConfigTag.List("numberSystem",
                              "Number system",
                              "",
                              "European",
                              ConfigTag.Optionality.C_Mandatory,
                              "Armenian|Chinese|Devanagari|EasternArabic|EasternNagari|Ethiopian|European|Guajarati|Gurmukhi|Hebrew|Japanese|Kannada|Khmer|Korean|Lepcha|Malayalam|Mongolian|Oriya|Persian|Tamil|Telugu|Thai")).
      setPrefix("<!-- Start of miscellaneous data -->");

    addTag(new ConfigTag.List("versificationScheme",
                              "Versification scheme",
                              "",
                              "eng",
                              ConfigTag.Optionality.C_Mandatory,
                              "automatic|eng|kjv|pes|other"));

    addTag(new ConfigTag.List("encoding",
                              "File encoding",
                              "",
                              "UTF-8",
                              ConfigTag.Optionality.C_Mandatory,
                              "UTF-8"));


    addTag(new ConfigTag.Header(""));
    addTag(new ConfigTag.Header("Anatomy of scripture references"));

    addTag(new ConfigTag.Text("chapterAndVerseSeparator",
                              "[DEPRECATED: Use equivalent internal/external tags] Chapter/verse separator",
                              "eg the colon in Jn 3:16",
                              ":",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("rangeSeparator",
                              "[DEPRECATED: Use equivalent internal/external tags] Separator used in reference ranges",
                              "eg the dash in Jn 3:16-17",
                              "-",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("multiRefSameChapterSeparator",
                              "[DEPRECATED: Use equivalent internal/external tags] Separator between multiple refs to the same chapter",
                              "eg the comma in Jn 3:16, 18",
                              ",",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("multiRefDifferentChapterSeparator",
                              "[DEPRECATED: Use equivalent internal/external tags] Separator between multiple refs to different chapters",
                              "eg the semicolon in Jn 3:16-18; 4:12",
                              ";",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("internalSeparatorChapterAndVerse",
                              "Chapter/verse separator as used in USX/USFM",
                              "eg the colon in Jn 3:16",
                              ":",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("internalSeparatorRangeSameChapter",
                              "Range separator when refs are in same chapter as used in USX/USFM",
                              "eg the dash in Jn 3:16-17",
                              "-",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("internalSeparatorRangeDifferentChapters",
                              "Range separator when refs are in different chapters as used in USX/USFM",
                              "eg the double dash in Jn 3:16--17",
                              "-",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("internalSeparatorMultiSameChapter",
                              "Separator between multiple refs to same chapter as used in USX/USFM",
                              "eg the comma in Jn 3:16, 18",
                              ",",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("internalSeparatorMultiDifferentChapters",
                              "Separator between multiple refs to different chapters as used in USX/USFM",
                              "eg the semicolon in Jn 3:16-18; 4:12",
                              ";",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("externalSeparatorChapterAndVerse",
                              "Chapter/verse separator used for display",
                              "eg the colon in Jn 3:16",
                              ":",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("externalSeparatorRangeSameChapter",
                              "Range separator when refs are in same chapter used for display",
                              "eg the dash in Jn 3:16-17",
                              "-",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("externalSeparatorRangeDifferentChapters",
                              "Range separator when refs are in different chapters used for display",
                              "eg the double dash in Jn 3:16--17",
                              "-",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("externalSeparatorMultiSameChapter",
                              "Separator between multiple refs to same chapter used for display",
                              "eg the comma in Jn 3:16, 18",
                              ",",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("externalSeparatorMultiDifferentChapters",
                              "Separator between multiple refs to different chapters, used for display",
                              "eg the semicolon in Jn 3:16-18; 4:12",
                              ";",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.List("verseNumberLocation",
                              "Where verse numbers should appear relative to text",
                              "At least some RTL languages put verse numbers at the END of verses",
                              "Begin",
                              ConfigTag.Optionality.C_Mandatory,
                              "Begin|End"));

    addTag(new ConfigTag.Text("prefixForVerseMarkersWhichAppearAtStartOfVerse",
                              "Prefix for verse markers which appear at start of verse",
                              "If verse markers come at the start of the verse, any prefix which should precede them.  This will often be blank.",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("suffixForVerseMarkersWhichAppearAtStartOfVerse",
                              "Suffix for verse markers which appear at start of verse",
                              "If verse markers come at the start of the verse, any suffix which should follow them.  This will often be blank.",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("prefixForVerseMarkersWhichAppearAtEndOfVerse",
                              "Prefix for verse markers which appear at end of verse",
                              "If verse markers come at the end of the verse, any prefix which should precede them.  This will often be blank.",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("suffixForVerseMarkersWhichAppearAtEndOfVerse",
                              "Suffix for verse markers which appear at end of verse",
                              "If verse markers come at the end of the verse, any suffix which should follow them.  This will often be blank.",
                              "",
                              ConfigTag.Optionality.C_Optional));



    addTag(new ConfigTag.Header(""));
    addTag(new ConfigTag.Header("Character mappings"));

    addTag(new ConfigTag.Text("vernacularTranslations",
                              "Vernacular character mappings",
                              "Space-separated list of pieces of text, with an even number of items. If the 1st item of any pair appears in the input text, we replace it by the 2nd. (Give the 2nd as 'delete' to delete the item.) Useful eg for the '<<' used to indicate quote marks.",
                              "",
                              ConfigTag.Optionality.C_Optional));



    addTag(new ConfigTag.Header(""));
    addTag(new ConfigTag.Header("Footnotes"));

    addTag(new ConfigTag.List("footnoteMarkerStyle",
                              "Circulate amongst fixed markers or increment?",
                              "'Increment' goes eg 1, 2, 3 etc.  'Circulate' runs over the list of available markers, and starts doubling them up if you run out.",
                              "Increment",
                              ConfigTag.Optionality.C_Optional,
                              "Circulate|Increment"));

    addTag(new ConfigTag.List("footnoteMarkerResetAt",
                              "Reset footnote markers at",
                              "The point at which we start again from 1",
                              "Book",
                              ConfigTag.Optionality.C_Optional,
                              "Never|Book|Chapter|Verse"));

    addTag(new ConfigTag.Text("footnoteMarkers",
                              "Markers to be used for footnotes",
                              "This is ignored if you specified 'Increment' above.  Otherwise, give a space-separated list of markers.",
                              "a b c d e f g h i j k l m n o p q r s t u v w x y z",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Header(""));
    addTag(new ConfigTag.Header("Miscellaneous"));

    addTag(new ConfigTag.Boolean("checkVersification",
                                 "Validate versification?",
                                 "Normally yes, but might be no if you have incomplete text or an unusual versification scheme",
                                 true,
                                 ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.List("includeBookNameInChapterHeadings",
                              "Include book name in chapter headings",
                              "Chapter headings are either just the number, or the number preceded by the book name",
                              "No",
                              ConfigTag.Optionality.C_Optional,
                              "No|Yes"));

    addTag(new ConfigTag.Text("translationId",
                              "SIL translation id",
                              "SIL translation id (number assigned by SIL)",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("revision",
                              "Revision",
                              "Any revision number you use to track different versions of the text",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("osis2SwordOptions",
                              "OSIS-to-Sword options",
                              "If you use osis2Mod to convert OSIS to Sword, you may need to specify eg versification options",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.List("textDir",
                              "Text direction",
                              "Left-to-right (ltr) or right-to-left (rtl).",
                              "ltr",
                              ConfigTag.Optionality.C_Mandatory,
                              "ltr|rtl"));

    addTag(new ConfigTag.List("chapterAndVerseDisplayOrder",
                              "Display order for chapter and verse",
                              "cv if chapter first, otherwise vc.  Typically used on some (all?) RTL languages.",
                              "cv",
                              ConfigTag.Optionality.C_Optional,
                              "cv|vc"));

    addTag(new ConfigTag.Boolean("hasNotes",
                                 "Tick if there are notes and they are to be processed",
                                 "",
                                 true,
                                 ConfigTag.Optionality.C_Mandatory));

    addTag(new ConfigTag.Text("copyright",
                              "Copyright",
                              "Copyright",
                              "@isoWithVariant@ scripture.  Copyright Kalaam Media Ltd.  All rights reserved.",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("coverTitle",
                              "Title used on cover page",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional)).
      setSuffix("<!-- End of miscellaneous data -->");
  }


  /****************************************************************************/
  /* Add details of text tags. */

  private void doTagsText ()
  {
    setTabNo("Text");

    addTag(new ConfigTag.Header("Vernacular name used to navigate to ..."));

    addTag(new ConfigTag.Text("coverVernacularString",
                              "... the cover",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional)).
     setPrefix("<!-- Start of text strings -->");

    addTag(new ConfigTag.Text("titlePageVernacularString",
                              "... the title page",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("promotionalVernacularString",
                              "... the promotional page",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("imprimaturVernacularString",
                              "... the imprimatur page",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("publicationDataVernacularString",
                              "... the publication data page",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("forewordVernacularString",
                              "... the foreword",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("prefaceVernacularString",
                              "... the preface",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("tableOfContentsVernacularString",
                              "... the table of contents",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("alphabeticalContentsVernacularString",
                              "... the alphabetical contents",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("tableOfAbbreviationsVernacularString",
                              "... the table of abbreviations",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("bibleIntroductionVernacularString",
                              "... the Bible introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("oldTestamentIntroductionVernacularString",
                              "... the Old Testament introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("pentateuchIntroductionVernacularString",
                              "... the Pentateuch introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("historyIntroductionVernacularString",
                              "... the history introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("poetryIntroductionVernacularString",
                              "... the poetry introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("prophecyIntroductionVernacularString",
                              "... the prophecy introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("newTestamentIntroductionVernacularString",
                              "... the New Testament introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("gospelsIntroductionVernacularString",
                              "... the Gospels introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("actsIntroductionVernacularString",
                              "... the Acts introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("epistlesIntroductionVernacularString",
                              "... the Epistles introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("revelationIntroductionVernacularString",
                              "... the Revelation introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("deuterocanonIntroductionVernacularString",
                              "... the Deuterocanon introduction",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("chronologyVernacularString",
                              "... the chronology",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("weightsMeasuresVernacularString",
                              "... the weights and measures",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("mapIndexVernacularString",
                              "... the map index",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("concordanceVernacularString",
                              "... the concordance",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("glossaryVernacularString",
                              "... the glossary",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("topicalIndexVernacularString",
                              "... the topical index",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("namesIndexVernacularString",
                              "... the names index",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("readingPlanVernacularString",
                              "... the reading plan",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional));

    addTag(new ConfigTag.Text("notesVernacularString",
                              "... notes",
                              "",
                              "",
                              ConfigTag.Optionality.C_Optional)).
     setSuffix("<!-- End of text strings -->");
  }


  /****************************************************************************/
  /* Used to keep track of the latest tags created when setting up Bible book
   * details.
   */

  private ConfigTag.Generic m_BookTag1 = null;
  private ConfigTag.Generic m_BookTag2 = null;
}
